home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Typography Samples / Circular Layout ƒ / QDGX shell.h < prev   
Encoding:
C/C++ Source or Header  |  1996-06-19  |  3.6 KB  |  129 lines  |  [TEXT/KAHL]

  1. /****************************************************************************/
  2. /*                                                                            */
  3. /*    interfaces for a simple, MULTI-window graphics shell                    */
  4. /*                                                                            */
  5. /*    6/96 bob    Updated #includes to support changed GX Library names.        */
  6. /*                Updated the copyright date.                                    */
  7. /*                                                                            */
  8. /*    ©1990 - 1996  Apple Computer, Inc.                                        */
  9. /*    All rights reserved.                                                    */
  10. /*                                                                            */
  11. /****************************************************************************/
  12.  
  13. #include <Desk.h>
  14. #include <Events.h>
  15. #include <Fonts.h>
  16. #include <Windows.h>
  17. #include <Memory.h>
  18. #include <ToolUtils.h>
  19. #include <Menus.h>
  20. #include <Resources.h>
  21. #include <Quickdraw.h>
  22. #include <GestaltEqu.h>
  23. #include <CodeFragments.h>
  24.  
  25. #include <GXEnvironment.h>
  26. #include <GXGraphics.h>
  27. #include "GraphicsLibraries.h"
  28. #include <GXErrors.h>
  29. #include "FontLibrary.h"
  30. #include "QDLibrary.h"
  31. #include <GXPrinting.h>
  32.  
  33.  
  34.  
  35.  
  36. /**\
  37. |**| ---------------------------------------------------------------------
  38. |**| EXTERN GLOBALS
  39. |**| ---------------------------------------------------------------------
  40. \**/
  41. // the following are expected to be initialized by the shell:
  42.  
  43. // QuickDraw GX shell.c:
  44.  
  45. extern Boolean        gQuitting;
  46.  
  47. // the following are expected to be initialized by your code:
  48.  
  49. extern Rect         gWindowQDRect;
  50. extern Str255        gWindowTitle;
  51. extern Boolean        gDebugging;
  52. extern Boolean        gGiveMeValidation;
  53. extern long            gGraphicsHeapSize;
  54.  
  55.  
  56.  
  57. /**\
  58. |**| ---------------------------------------------------------------------
  59. |**| PROTOTYPES
  60. |**| ---------------------------------------------------------------------
  61. \**/
  62.  
  63. // QuickDraw GX shell.c:
  64.  
  65. void    main                    (void);
  66. void     InitToolbox                (void);
  67. void    CheckQuickDrawGX        (void);
  68. OSErr    MyPrintingEventOverride    (EventRecord *event, Boolean filterEvent);
  69. void    EventLoop                (void);
  70. Boolean    IsAppWindow                (WindowPtr wind);
  71. void    MyDoEvent                (EventRecord *event);
  72. void    DoMouseDown                (EventRecord *event);
  73.  
  74. // QDGX shell misc.c:
  75.  
  76. void    DoMenuCommand            (long menuResult);
  77. gxJob    GetDocJob                (WindowPtr);
  78. gxShape    GetDocShape                (WindowPtr);
  79. gxShape    GetDocOvalShape            (WindowPtr);
  80. gxShape    GetDocEraseShape        (WindowPtr);
  81. short    MyStrLength                (char *s);
  82.  
  83. // QDGX shell printing.c:
  84.  
  85. void    SetUpEditMenuRec        (gxEditMenuRecord *);
  86. OSErr    DoFormat                (WindowPtr, gxDialogResult    *);
  87. OSErr    DoPrinting                (WindowPtr);
  88. OSErr    DoPrintOne                (WindowPtr);
  89.  
  90. // routines required by your code
  91. void    DoSetup                    (void);
  92. void    DoDraw                    (WindowPtr wind, Boolean updating);
  93. OSErr    DoCreateNew                (void);
  94. void    DoDispose                (WindowPtr wind);
  95. void    DoIdle                    (WindowPtr wind);
  96. void    DoTeardown                (void);
  97. void    DoClick                    (WindowPtr wind, Point p);
  98.  
  99.  
  100.  
  101. /**\
  102. |**| ---------------------------------------------------------------------
  103. |**| ENUMS
  104. |**| ---------------------------------------------------------------------
  105. \**/
  106. enum dlogIDs {rAboutBoxID=128,rNoQuickDrawGXID=129};
  107.  
  108. enum mbarID {rMenuBar=128};
  109.  
  110. enum menus {mApple=128,mFile,mEdit};
  111.  
  112. enum mApplItems {iAbout=1};
  113. enum mFileItems {iNew=1,iOpen,iClose,iSave,iPageSetup=6,iPrint,iPrintOne,iQuit=10};
  114. enum mEditItems {iUndo=1,iCut=3,iCopy,iPaste,iClear};
  115.  
  116.  
  117. /**\
  118. |**| ---------------------------------------------------------------------
  119. |**| STRUCTS
  120. |**| ---------------------------------------------------------------------
  121. \**/
  122. // This is the structure we use to hold our private data for each window.
  123. // We store a handle to one of these beasties in each window's refCon field.
  124.  
  125. typedef struct {
  126.               gxJob        docJob;            // print job for this document.
  127.               gxShape    docOval;        // the oval for this window's document.
  128.               gxShape    eraseOval;        // the oval to erase the previous drawing oval.
  129. } T_Doc, *TP_Doc, **TH_Doc;